const path = require('path');
const CopyWebpackPlugin = require('copy-webpack-plugin');

const resolve = dir => {
	return path.join(__dirname, dir);
};

module.exports = {
	// css相关配置
	css: {
		// css预设器配置项
		loaderOptions: {
			scss: {
				// 默认加载全局变量文件 index.scss
				prependData: `@charset "UTF-8"; @import "~src/uni.scss"; @import "~scss/helpers/index.scss";`
			}
		}
	},
	devServer: {
		port: 8000,
		host: '0.0.0.0'
	},
	chainWebpack: config => {
		// 重新设置 alias
		config.resolve.alias
			// 静态资源地址
			.set('@', resolve('src'))
			// scss 资源地址
			.set('scss', resolve('src/scss'))
			.set('utils', resolve('src/utils'))
			.set('components', resolve('src/components'))
			.set('pages', resolve('src/pages'))
			.set('api', resolve('src/api'))
			.set('src', resolve('src'));
	},
	// eslint-disable-next-line no-dupe-keys
	configureWebpack: config => {
		
	}
};
